package com.yq.homework.day22;

import javax.lang.model.element.NestingKind;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.Scanner;

/**
 * @author 3307235355@qq.com
 * @since 2022/06/22 17:31
 * 计算出生多少天
 */
public class Demo02 {
    public static void main(String[] args) throws ParseException {
        // CalculationDays.sumDays();
        int a =122;
        System.out.format("%08d%n",a);
        System.out.format("%-8d%n",a);
    }
}
class CalculationDays{
    private  CalculationDays(){}
    public static void sumDays() throws ParseException {
        Scanner scanner = new Scanner(System.in);
        System.out.println("输入的的出生日期格式为：年-月-日：");
        String next = scanner.next();
        Date parse = new SimpleDateFormat("yyyy-MM-dd").parse(next);
        long time1 = parse.getTime();
        long time2 = System.currentTimeMillis();
        long days = time2 - time1;
        long day = days/1000/60/60/24;
        System.out.println("你到这个世界"+day+"天");
    }

}